Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

312
Visualizações
How do I resolve "Firebase: Error (auth/network-request-failed)." in a react cordova app?

I am working on a react cordova app, and I'm trying to authenticate my users with Firebase createUserWithEmailAndPassword. The problem however is it always return this "Firebase: Error (auth/network-request-failed)." anytime I click the sign up button. I have enabled Email/Password as one of my sign in methods in my firebase console, and I have tried both the older version of firebase and the newest version 9 Modular SDK version, I have also ensured that my sign in button is not of type submit and also prevented event default in my button function. All these are answers that people have given to this question but none of these has helped me so far.

import { getAuth, createUserWithEmailAndPassword } from "firebase/auth";

const signInWithEmail = (setAlertState, setAlertMessage) => {

const auth = getAuth();

createUserWithEmailAndPassword(auth, document.getElementById("email-input"), document.getElementById("password-input")).then((userCredential) => { 

const user = userCredential.user;

setAlertState(true);
setAlertMessage(user.uid);

}).catch((error) => {

const errorCode = error.code;
const errorMessage = error.message;

setAlertState(true);
setAlertMessage(errorCode);

});
    
}

export default signInWithEmail;
<Button
color="primary"
variant="contained"
type="input"
onClick={(event) => {
event.preventDefault();
signInWithEmail(setAlertState, setAlertMessage);
}}
sx={{
position:"relative",
marginTop:"1.5rem",
width:"100%",
height:"3rem",
borderRadius:"1rem",
color:"custom.main",
}}
>
Sign In
</Button>

Image of errorMessage

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda